package com.hfb.io.netty.chat;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;

public class ChatClientHandler extends SimpleChannelInboundHandler<String> {

    @Override
    public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
        System.out.println("客户端收到服务器消息:" + msg.toString().trim());
    }

    @Override
    protected void messageReceived(ChannelHandlerContext channelHandlerContext, String s) {
        System.err.println("客户端收到服务器消息:" + s.trim());
    }
}
